<!--
 * @message: 数据字典类别更新组件
-->
<template>
  <div>
    <Form
      :label-width="150"
      ref="formValidate"
      :rules="ruleValidate"
      :model="formValidate"
      label-position="left"
    >
      <FormItem label="数据字典类别名称" prop="itemName">
        <i-input
          type="text"
          v-model="formValidate.itemName"
          placeholder=""
        >
        </i-input>
      </FormItem>
      <FormItem label="数据字典类别编号" prop="itemCode">
        <i-input
          type="text"
          v-model="formValidate.itemCode"
          placeholder=""
        >
        </i-input>
      </FormItem>
      <FormItem label="备注" prop="">
        <i-input
          type="textarea"
          v-model="formValidate.memo"
          placeholder="备注"
        >
        </i-input>
      </FormItem>
      <FormItem>
        <Button
          type="primary"
          @click="publicSubmit('formValidate')"
        >确定
        </Button>
        <Button @click="publicReset('formValidate')" style="margin-left: 8px">取消</Button>
      </FormItem>
    </Form>
  </div>
</template>

<script>
import API_KEY from '../../../api'
import { updateMixin } from '../../../mixin'

export default {
  name: 'DictionaryTypeUpdate',
  mixins: [updateMixin],
  data () {
    return {
      formValidate: {
        itemName: '',
        itemCode: '',
        memo: ''
      },
      ruleValidate: {
        itemName: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        itemCode: [{ required: true, message: '当前项不能为空', trigger: 'blur' }]

      },
      action: {
        // 新增数据
        createData: API_KEY.dictionary.insertRootDictionary,
        // 更新数据
        updateData: API_KEY.dictionary.updateRootDictionary,
        readDataById: API_KEY.dictionary.curdDictionary
      }
    }
  }
}
</script>

<style scoped>

</style>
